package cn.webrx;

import java.io.FileInputStream;
import java.io.FileNotFoundException;

public class Excep3 {
    public static void main(String[] args) {
        User u = new User();

        while (true) {
            try {
                u.setSex("男");
                FileInputStream fis = new FileInputStream("abc.txt");
                break;
            } catch (SexException e) {
                System.out.println("性别设置错误，必须是男或女");
            } catch (FileNotFoundException e) {
                System.out.println("文件不存在");
            } catch (Exception e) {
                System.out.println("系统未知错误");
            } finally {
                System.out.println("有没有异常都要执行");
            }
            System.out.printf("sssss");
        }

        System.out.println("程序结束");
    }
}
